<!--  -->
<template>
  <div class="detail-base-info" v-if="Object.keys(goods).length !== 0">
    <div class="goods-title">{{ goods.title }}</div>
    <div class="goods-price">
      <span class="n-price">{{ goods.newPrice }}</span>
      <span class="o-price">{{ goods.oldPrice }}</span>
      <span class="discount">{{ goods.discount }}</span>
    </div>
    <div class="goods-other">
      <span>{{ goods.columns[0] }}</span>
      <span>{{ goods.columns[1] }}</span>
      <span>{{ goods.services[goods.services.length - 1].name }}</span>
    </div>
    <div class="goods-services">
      <span
        v-for="index in goods.services.length - 1"
        :key="index"
        class="goods-services-item"
      >
        <img :src="goods.services[index - 1].icon" alt="" />
        <span>{{ goods.services[index - 1].name }}</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: "detailbaseInfo",
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>
<style  scoped>
.detail-base-info {
  margin-top: 15px;
  padding: 0 8px;
  color: #999;
  border-bottom: 5px solid #f2f5f8;
}
.goods-title {
  color: #222;
}
.goods-price {
  margin-top: 10px;
}
.goods-price .n-price {
  font-size: 24px;
  color: var(--color-high-text);
}
.goods-price .o-price {
  font-size: 17px;
  margin-left: 5px;
  text-decoration: line-through;
}
.goods-other {
  display: flex;
  padding-top: 8px;
  border-top: 1px solid rgba(100, 100, 100, 1);
}
.goods-other span {
  flex: 1;
}
.goods-services {
  display: flex;
  margin-top: 15px;
}
.goods-services .goods-services-item {
  flex: 1;
}
.goods-services .goods-services-item img {
  height: 12px;
  color: #222;
}
.goods-services .goods-services-item span {
  font-size: 12px;
  color: #222;
}
</style>